package com.zmsoft.persistent.sfg.Sfg661021PlayerLand;

import javax.annotation.Resource;

import org.cnsoft.framework.beans.common.RESTResultBean;
import org.cnsoft.framework.constants.ECCodeMessageConstants;
import org.cnsoft.framework.db.page.PageModel;
import org.cnsoft.framework.support.MyBusinessSupport;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
 * 玩家农场土地信息业务处理
 */
@Component("Sfg661021PlayerLandBusinesslogic")
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class Sfg661021PlayerLandBusinesslogic extends MyBusinessSupport {
	@Resource
	private Sfg661021PlayerLandDao daoSfg661021PlayerLand;

	// 一览（分页查询）
	public RESTResultBean<Sfg661021PlayerLandDBO> doList(PageModel<Sfg661021PlayerLandDBO> pageModel) {
		// 定义返回结果集合
		RESTResultBean<Sfg661021PlayerLandDBO> result = new RESTResultBean<Sfg661021PlayerLandDBO>();
		// 分页查询
		result.setData(daoSfg661021PlayerLand.doSelectPage(pageModel));
		// 设定提示信息
		result.setResult(ECCodeMessageConstants.MESSAGE_DB_SELECT);
		// 输出结果日志
		logger.debug("result=====>>>>" + result.toString());
		return result;
	}

	// 信息详情
	public RESTResultBean<Sfg661021PlayerLandDBO> doInfo(Sfg661021PlayerLandDBO param) {
		// 定义返回结果集合
		RESTResultBean<Sfg661021PlayerLandDBO> result = new RESTResultBean<Sfg661021PlayerLandDBO>();
		// 查询详情
		result.setData(daoSfg661021PlayerLand.doRead(param));
		// 设定提示信息
		result.setResult(ECCodeMessageConstants.MESSAGE_DB_SELECT);
		// 输出结果日志
		logger.debug("result=====>>>>" + result.toString());
		return result;
	}

	// 信息插入
	public RESTResultBean<String> doAppend(Sfg661021PlayerLandDBO param) {
		// 定义返回结果集合
		RESTResultBean<String> result = new RESTResultBean<String>();
		// 信息插入
		daoSfg661021PlayerLand.doInsertSelective(param);
		// 设定提示信息
		result.setResult(ECCodeMessageConstants.MESSAGE_DB_INSERT);
		// 输出结果日志
		logger.debug("result=====>>>>" + result.toString());
		return result;
	}

	// 信息编辑
	public RESTResultBean<String> doModify(Sfg661021PlayerLandDBO param) {
		// 定义返回结果
		RESTResultBean<String> result = new RESTResultBean<String>();
		// 信息插入
		daoSfg661021PlayerLand.doUpdate(param);
		// 设定提示信息
		result.setResult(ECCodeMessageConstants.MESSAGE_DB_UPDATE);
		// 输出结果日志
		logger.debug("result=====>>>>" + result.toString());
		return result;
	}

	// 信息删除
	public RESTResultBean<String> doDiscard(Sfg661021PlayerLandDBO param) {
		// 定义返回结果
		RESTResultBean<String> result = new RESTResultBean<String>();
		// 输出参数日志
		logger.debug("param=====>>>>" + param.toJsonString());
		// 信息插入
		daoSfg661021PlayerLand.doDelete(param);
		// 设定提示信息
		result.setResult(ECCodeMessageConstants.MESSAGE_DB_DELETE);
		// 输出结果日志
		logger.debug("result=====>>>>" + result.toString());
		return result;
	}

}
